package com.yf.tz.entity;


import lombok.Setter;
import lombok.Getter;
import java.io.Serializable;
import java.util.Date;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单实体
 * 表名 mall_order
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Mon Jul 20 16:20:50 CST 2020
 */
@Setter
@Getter
public class MallOrderEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    //ID
    private Long id;
    //订单编号
    private String orderNo;
    //总价
    private BigDecimal price;
    //总数
    private Integer quantity;
    //总积分
    private BigDecimal point;
    //实际支付
    private BigDecimal pay;
    //ENUM-是否支付:"NO-否","YES-是"
    private Integer paid;
    //订单时间
    private Date orderTime;
    //起止时间
    Date[] orderTimes;
    //支付时间
    private Date payTime;
    //起止时间
    Date[] payTimes;
    //发货时间
    private Date sendTime;
    //起止时间
    Date[] sendTimes;
    //ENUM-订单状态:"NEW-新订单","DELIVERING-配货中","DELIVERED-已发货"
    private Integer orderStatus;
    //省
    private String province;
    //市
    private String city;
    //县
    private String county;
    //详细地址
    private String detail;
    //手机号
    private String phone;
    //收货人
    private String name;
    //物流公司
    private String logCompany;
    //用户ID
    private Long userId;
    //ENUM-支付方式:"WX-微信","CEC-电子币"
    private Integer payWay;
    //物流费
    private BigDecimal logFee;
    //物流单号
    private String logNo;
    //备注
    private String remark;



    public MallOrderEntity(){

    }

    public MallOrderEntity(String orderNo,Integer paid, Date orderTime, Integer orderStatus, String province, String city, String county, String detail, String phone, String name, Long userId, Integer payWay,String remark) {
        this.orderNo = orderNo;
        this.paid = paid;
        this.orderTime = orderTime;
        this.orderStatus = orderStatus;
        this.province = province;
        this.city = city;
        this.county = county;
        this.detail = detail;
        this.phone = phone;
        this.name = name;
        this.userId = userId;
        this.payWay = payWay;
        this.remark = remark;
    }

    public String getAddress(){
        return province+county+city+detail;
    }

    private List<MallItemEntity> items;
}
